<?php

$fields = array(

	'path' => array(
		'validation' => array('trim', 'required', 'min_length'=>3),
		'type' => 'text',
		'element_class' => 'longtext',
		'caption' => __('Regular expression'),
	),

	'url' => array(
		'validation' => array('trim', 'required', 'min_length'=>3),
		'type' => 'text',
		'element_class' => 'longtext',
		'caption' => __('Relative link'),
	),

	'state' => array(
		'validation' => array('required'),
		'type' => 'radio',
		'list' => ':states',
		'caption' => __('State'),
		'class' => 'float',
	),

	'type' => array(
		'validation' => array('required'),
		'type' => 'select',
		'list' => ':types',
		'caption' => __('Type'),
		'class' => 'column',
//		'extra' => ':clear',
	),

	'order' => array(
		'validation' => array('trim', 'required', 'number'),
		'type' => 'text',
		'caption' => __('Order'),
		'class' => 'column column-last',
		'extra' => ':clear',
	),



	'text' => array(
		'validation' => array('trim', 'required', 'min_length'=>2),
		'type' => 'text',
		'element_class' => 'longtext',
		'caption' => __('Text field'),
	),

	'title' => array(
		'validation' => array('trim', 'required', 'min_length'=>2),
		'type' => 'text',
		'element_class' => 'longtext',
		'caption' => __('Title attribute'),
	),

);

/*
$empty = array(

	// common
	'region' => array(
		'type' => 'select',
		'label' => __('Area'),
		'list' => ':area_list',
		'class' => 'column'
	),

	// common
	'city' => array(
		'validation' => array('trim'),
		'type' => 'text',
		'label' => __('City'),
		'class' => 'column wide column-last',
		'extra' => ':clear',
		'value' => 'Москва',
//		'meta' => array( 'tags' => $this->storage->popular_cities() ),
	),


	// common
	'urls' => array(
		'validation' => array('trim','required'),
		'type' => 'text',
		'class' => 'column wide',
		'element_class' => 'longtext',
		'caption' => __('Website'),
		'extra' => ':clear',
	),

	'phone' => array(
		'type' => 'text',
		'element_class' => 'longtext',
		'label' => __('Phone'),
	),

	// common fields
	'action' => array(
		'type' => 'fieldset',
		'legend' => __('Event/Call'),
		'class' => 'column wide',
		'elements' => array(

			'date' => array(
				'validation' => array(
					'trim',
					'required',
					array('callback' => array($this, 'check_date_validator'))
				),
				'type' => 'text',
				'label' => __('Date'),
				'value' => date(__('Y-m-d')),
				'class' => 'column short',
				'element_class' => 'shorttext'
			),

			'time' => array(
				'validation' => array(
					'trim',
					'required',
					array('callback' => array($this, 'check_time_validator'))
				),
				'type' => 'text',
				'label' => __('Time'),
				'value' => date('H:i'),
				'class' => 'column short',
				'element_class' => 'shorttext',
				'after' => '<p><label for="action_time_checkbox"><input id="action_time_checkbox" type="checkbox" /> ' . __('Anytime') . '</label></p>',
				'extra' => ':clear',
			),

			'type' => array(
				'validation' => array('required'),
				'type' => 'radio',
				'list' => ':action_types',
				'class' => 'alinks float',
				'value' => 'incall',
				'caption' => __('Event type')
			),

			'topic' => array(
				'validation' => array('trim', 'required'),
				'type' => 'text',
				'element_class' => 'longtext',
				'caption' => __('Topic'),
			),

			'desc' => array(
				'validation' => array('trim'),
				'type' => 'textarea',
				'element_class' => 'longtext',
				'caption' => __('Description')
			)

		)
	),

	'person' => array(

		'type' => 'fieldset',
		'legend' => __('Add contact'),
		'class' => 'column wide column-last',
		'extra' => ':clear',
		'elements' => array(

			// old client and company
			'lastname' => array(
				'validation' => array('trim','min_length'=>2),
				'type' => 'text',
				'element_class' => 'longtext',
				'caption' => __('LastName'),
			),

			'firstname' => array(
				'validation' => array('trim', 'required','min_length'=>2),
				'type' => 'text',
				'element_class' => 'longtext',
				'caption' => __('FirstName'),
			),

			'middlename' => array(
				'validation' => array('trim','min_length'=>2),
				'type' => 'text',
				'element_class' => 'longtext',
				'label' => __('MiddleName')
			),

			// old client and company
			'is_decider' => array(
				'type' => 'checkbox',
				'list' => array( 1 => __('Have right to decide') ),
			),

			'position' => array(
				'type' => 'text',
				'element_class' => 'longtext',
				'label' => __('Position'),
//				'meta' => array( 'tags' => $this->storage->popular_positions() ),
			),

			// common
			'phone' => array(
				'type' => 'text',
				'element_class' => 'longtext',
				'label' => __('Phone'),
			),

			'cell' => array(
				'type' => 'text',
				'element_class' => 'longtext',
				'label' => __('Cellphone')
			),

			'email' => array(
				'validation' => array('valid_email'),
				'type' => 'text',
				'element_class' => 'longtext',
				'label' => __('E-mail')
			),

		)
	)

);

/**/
